<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2024-9-22
  Time: 16:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
    <link href="css/font-awesome.min.css" rel="stylesheet"/>
    <title>用户管理</title>
    <style>
        /*.search-wrap {*/
        /*    padding: 15px 0;*/
        /*    border-bottom: 1px solid #e5e5e5;*/
        /*}*/
        .label {
            height: 30px;
            line-height: 30px;
            padding: 2px 4px;
        }
        .common-text {
            height: 30px;
            line-height: 30px;
            padding: 2px 4px;
            border: 1px solid #ccc;
            background: #fff;
            border-radius: 5px;
        }
        .search-tab tr {
            line-height: 35px;
        }

        .search-tab th {
            text-align: right;
            padding-right: 10px;
            font-weight: normal;
        }

        .search-tab td {
            padding: 0 5px;
        }
        .result-tab {
            border-collapse: collapse;
            border: 1px solid #ddd;
            width: 100%;
        }

        .result-tab th {
            font-weight: normal;
            font-size: 15px;
            text-align: center;
            /*background: url(../images/tab-thbg.png) #f9f9f9 0 bottom repeat-x;*/
        }

        .result-tab th,.result-tab td {
            padding: 5px;
            border-bottom: 1px solid #ddd;
            border-right: 1px solid #e1e1e1;
        }

        .result-tab tr {
            line-height: 35px;
        }

        .result-tab th.tc,.result-tab td.tc {
            text-align: center;
        }

        .result-tab tr:nth-child(odd) {
            background: #f9f9f9;
        }

        .result-tab tr:hover {
            background: #f1f1f1;
        }

        .result-tab tr.even-tr {
            background: #e9fff2;
        }
        a:link {text-decoration: none;color:dodgerblue;}

        a:visited {color:green；text-decoration:none;}

        a:hover  {color:blue;text-decoration:underline;}

        a:active {color:orange;text-decoration:blink;}
    </style>
</head>
<body>
<div style="text-align: center;">
    <h2>用户管理</h2>
</div>
<div class="search-wrap">
    <div class="search-content">
        <form action="#" method="post">
            <table class="search-tab">
                <tr>

                    <th class="label" >用户名:</th>
                    <td><input class="common-text" placeholder="关键字"
                               name="keywords" value="" type="text"></td>
                    <th class="label" >性别:</th>
                    <td><select name="search-sort" class="common-text">
                        <option value="">全部</option>
                        <option value="0">男</option>
                        <option value="1">女</option>
                    </select>
                    </td>
                    <td>
                        <input class="btn btn-primary btn2" name="sub" style="height: 30px;" value="查询"
                               type="submit"></td>

                </tr>
            </table>
        </form>
    </div>
</div>
<div>
    <h3>
        <a href="UserServlet?method=new"><i class="fa fa-plus"></i> 新增用户</a>
    </h3>
</div>
<div class="result-content">
    <table class="result-tab">
        <tbody>
        <tr>
            <th>用户名</th>
            <th>密码</th>
            <th>姓名</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${userList}" var="user">
            <tr>
                <td>${user.username}</td>
                <td>${user.password}</td>
                <td></td>
                <td style="text-decoration:none;text-align:center">
                    <a href="edit?id=<c:out value='${user.id}' />">编辑</a>
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="delete?id=<c:out value='${user.id}' />">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>
</div>
</body>
</html>